package com.itqf.springboot_mvc.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * projectName: springboot_part
 *
 * http://10.9.45.22:8081/mvc/index/register
 *
 * @author: 赵伟风
 * time: 2021/9/17 10:34
 * description:第一个controller第一个handler
 */

@RestController
@RequestMapping("index")
public class IndexController {


    @RequestMapping("hello")
    public Object hello(){

        return "hello world!!";
    }

    /**
     * method不知名，代表支持全部请求方式
     * @return
     */
    //@RequestMapping(value = "login",method =RequestMethod.POST )

    @PostMapping("login")
    public Object login(){



        return "login";
    }

    //@RequestMapping(value = "register",method = RequestMethod.GET)
    //   ||
    @GetMapping("register")
    public Object register(){

        return "register";
    }


}
